package com.fan.leetcode;

import java.util.Arrays;

/**
 * 274. H 指数
 *
 * @author ZhangFan
 * @since 2021/8/3 下午 10:28
 */
public class Question274 {
    public int hIndex(int[] citations) {
        Arrays.sort(citations);
        int h = 0;
        for (int i = citations.length - 1; i >= 0; i--) {
            if (citations[i] > h) {
                h++;
            }
        }
        return h;
    }
}
